<?php
namespace app\admin\controller;
use think\Controller;
use app\admin\model\User as UserMode;
use app\admin\model\Adm as AdmModel;
use  think\Session;
class User extends Controller
{

	public function user(UserMode $user)
	{
		$this->userinfo($user);
		return $this->fetch();
	}
	public function shanghu()
	{
		return $this->fetch();
	}
	public function team(AdmModel $adm)
	{
		$result = $adm->teaminfo();
		$this->teamlden($result);
		
		$this->assign('result',$result);
		return $this->fetch();
	}
	protected function teamlden($result)
	{
		foreach ($result as $key => $value) {
			 $aid = $result[$key];//获取对象	 
			 $loging = $aid->lden;//查询身份
			 $lname = $loging[0]->name;
			 $result[$key]->sex = $lname;	
		}

	}
	public function xiangmuzu()
	{
		return $this->fetch();
	}
	protected function userinfo($user)
	{
		$userin = $user->userall();
		$this->assign('user',$userin);
	} 
}